[front] feat: wire Members/Groups tabs of the usage filter panel to real, period-scoped data - #30168
Conversation
|
This change is part of the following stack:
Change managed by git-spice. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
17731bc to
a72fed4
Compare
6a375c0 to
2f387e8
Compare
d57fe4a to
3418019
Compare
3418019 to
684c627
Compare
422d611 to
ae2261f
Compare
e3b3e3a to
b78e388
Compare
ae2261f to
9246936
Compare
b78e388 to
3df4875
Compare
9246936 to
a30cb37
Compare
3df4875 to
29acbab
Compare
a30cb37 to
c833b23
Compare
1ce2dfc to
5ac24fc
Compare
5ac24fc to
516e948
Compare
6f888c0 to
7a11ac9
Compare
516e948 to
7ee187b
Compare
a43056f to
d282602
Compare
7ee187b to
878cd0e
Compare
…eal, period-scoped data Members now come from the same period-ranked consumption data the Attribution table uses (useConsumptionTop) instead of the full, period-unaware member roster. Groups are no longer mock: a new relevant-groups endpoint resolves, for that same set of period-active users, which groups they belonged to during the period window (not "now"), via a new GroupResource.listGroupsForUserModelIdsInWindow.
Matches the naming convention already used by the consumption scope dimensions and consumptionDimensions.ts: the category key is "user" (same as the ES dimension it filters on), "Members" stays the display label. Avoids a per-category translation layer as more categories get wired to real data.
|
1834153 to
2003783
Compare
| selectedIds: Set<string>; | ||
| onToggleOption: (option: UsageFilterOption) => void; | ||
| onSelectAll: () => void; | ||
| // Only set for categories backed by a paginated server fetch (members). |
There was a problem hiding this comment.
removed when all the filtering are properly wired
aubin-tchoi
left a comment
There was a problem hiding this comment.
LGTM but let's start thinking about simplifying
| onFilterChange: (next: UsageFilter) => void; | ||
| } | ||
|
|
||
| export function UsageFilterPanel({ |
There was a problem hiding this comment.
React Doctor · react-doctor/no-giant-component (warning)
Component "UsageFilterPanel" is over 300 lines long, which is hard to read & change. Split it into a few smaller components.
Fix → Pull each section into its own component so the parent is easier to read, test, and change.
Description
This PR wires the Members and Groups tabs of the usage page's filter panel to real, period-scoped data, and connects the resulting
UsageFilterstate into the underlying consumption queries.Until now:
UsageFilterselection for the "member" dimension had no effect on the overview, chart, or attribution table queries.This PR:
relevant-groupsendpoint resolves, for that same set of period-active users, which groups they belonged to during the period window. This keeps the group list contextually relevant rather than listing all workspace groups unconditionally.UsageFilterstate (member dimension) is now forwarded to the overview, chart, and attribution table consumption queries, so filtering by member actually narrows the displayed data.A new route was added under
front-api/routes/— OpenAPI docs should be regenerated (npm -w front-api run docs) and published via theDeploy OpenAPI DocsGitHub action.Tests
Testing evidence was not provided for this draft.
Risk
Low. The changes are additive on the data-fetching side: the existing member roster fallback is replaced by a scoped query, and the new
relevant-groupsendpoint is a net-new read-only route. TheUsageFilterwiring only affects query parameters; no data model changes or migrations are involved. Safe to rollback by reverting the front deployment.Deploy Plan
front.